package com.konsung.ksdc.common.widget;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.PopupWindow;

import com.konsung.ksdc.R;

/**
 * 顶号提示弹窗
 */
public class ReLoginPopupWindow extends PopupWindow {

    private View view;
    public Button btnReLogin;

    /**
     * 构造方法
     * @param context 上下文
     * @param onClickListener 点击监听
     */
    public ReLoginPopupWindow(final Context context, View.OnClickListener onClickListener) {
        super(context);

        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context
                .LAYOUT_INFLATER_SERVICE);
        view = inflater.inflate(R.layout.relogin_popup, null);
        btnReLogin = (Button) view.findViewById(R.id.btn_relogin);

        btnReLogin.setOnClickListener(onClickListener);

        //设置PopupWindow的View
        this.setContentView(view);
        //设置PopupWindow弹出窗体的宽
        this.setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
        //设置PopupWindow弹出窗体的高
        this.setHeight(ViewGroup.LayoutParams.MATCH_PARENT);
        //设置PopupWindow弹出窗体可点击
        this.setFocusable(false);
        this.getBackground().setAlpha(100);
    }
}
